package com.example.easyexcel.controller;

import com.example.easyexcel.Service.TestService;
import com.example.easyexcel.util.FileReadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.List;

/**
 * 测试Controller
 *
 * @VERSION V1.0
 * @DESCRIPTION com.paic.luchang.center.aggregation.controller
 * @AUTH luchang
 * @DATE 2019/9/7
 */
@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping("/testResp")
    public List<String> testResp(HttpServletRequest request,String mobile){
        log.info("mobile={}",mobile);
        return testService.test(mobile);
    }

    public static void main(String[] args) {
        InputStream resourceFile = FileReadUtil.getResourceFile("templates/template01.xlsx");
        System.out.println(resourceFile);

        String classesFilePath = FileReadUtil.getClassesFilePath("templates/template01.xlsx");
        System.out.println(classesFilePath);
    }

}

